//
//  QBRootViewController.swift
//  QBDropDownWithSubTitleDemo
//
//  Created by 乐启榜 on 16/8/16.
//  Copyright © 2016年 乐启榜. All rights reserved.
//

import UIKit

class QBRootViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let firstVC = QBFirstViewController()
        let secondVC = QBSecondViewController()
        let thirdVC = QBThirdViewController()
        let fourVC = QBFourthViewController()
        let fiveVC = QBFiveViewController()
        let sixVC = QBSexViewController()
        let sevenVC = QBSevenViewController()
            
        firstVC.title = "推荐"
        secondVC.title = "新闻"
        thirdVC.title = "科技创新"
        fourVC.title = "人物"
        fiveVC.title = "历史"
        sixVC.title = "军事"
        sevenVC.title = "国内社会"

        let controllersArray = [firstVC,secondVC,thirdVC,fourVC,fiveVC,sixVC,sevenVC]
        
        let options: [QBPageMenuOptions]
            = [.MeunViewHeight(44),
               .MenuViewBackgroundColor(UIColor.whiteColor()),
               .MenuItemFont(UIFont.systemFontOfSize(19)),
               .MenuItemNormalColor(UIColor.blackColor()),
               .MenuItemSpace(15.0),
               .MenuItemDefaultIndex(0),
               .MenuIsSelectionIndicator(false),
               .MenuIsRightButton(false),
               .MenuRightButtonWidth(30),
               .MenuRightButtonBackgroundColor(UIColor.lightGrayColor()),
               .AnimationDuration(0.2)]
        
        let rect = CGRect(x: 0, y: 0, width: self.view.frame.width, height: self.view.frame.height)

        
        let menuMainVC: QBMenuMainController
            = QBMenuMainController(viewControllers: controllersArray,
                                             frame: rect,
                                   pageMenuOptions: options)
        

        self.addChildViewController(menuMainVC)
        self.view.addSubview(menuMainVC.view)
        menuMainVC.didMoveToParentViewController(self)
        
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
